package mspbots.data.tl.script.controller;

import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import mspbots.data.tl.script.service.ScriptService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

import java.util.Map;

/**
 * @author Jay.Yang
 */
@Log4j2
@RestController
@RequiredArgsConstructor
@RequestMapping("scrpit")
public class ScriptController {

    private final ScriptService scriptService;

    @PostMapping("prod/sqlData")
    public Flux<Map<String, Object>> executeSqlData(@RequestBody Map<String, String> map) {
        return this.scriptService.executeSqlData(map);
    }
}
